#! /bin/bash
#
# usage: maxFloTestScript algorithm
#
# Run unit test on series of random graphs, with a specified algorithm.
# The algorithm argument is one of ffShortPath, ffMaxCap, ffScale, dinic,
# dinicDtrees, ppFifo, ppFifoBatch, ppHiLab or ppHiLabBatch
#
algo="ffShortPath"
if [ $# -eq 1 ] ; then
	algo=$1
fi;
echo "testing algorithm: " $algo

echo "testing 10 vertex graph"
randGraph flograph 10 20 2 30 10 1 0 | testMaxFlo $algo show verify

echo "testing 20 vertex graph"
randGraph flograph 20 60 4 35 10 2 0 | testMaxFlo $algo show verify

echo "testing 100 vertex, 2000 edge graphs (10)"
for seed in 3 4 5 6 7 8 9 10 11 12; do
	randGraph flograph 100 2000 20 2500 100 $seed 0 | testMaxFlo $algo verify
done

echo ""; echo "testing 1000 vertex, 100000 edge graph"
randGraph flograph 1000 100000 200 1250 100 13 0 | testMaxFlo $algo verify
